﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using iPal.analysis;
using iPal.lexer;
using iPal.node;
using iPal.parser;

namespace Sablecc
{
    class Program
    {
        static void Main(string[] args)
        {
            string temp = Directory.GetCurrentDirectory();

            Stream st = new FileStream(Directory.GetCurrentDirectory() + "\\testCode.txt", FileMode.Open);
            StreamReader sr = new StreamReader(st);

            Lexer lex = new Lexer(sr);

            Parser parse = new Parser(lex);

            Start ast = parse.Parse();

            ast.Apply(new SemanticAnalyser());
            ast.Apply(new CodeGenerator());

            Console.WriteLine("**** DONE ****");
            Console.ReadLine();
        }
    }
}
